//
// Created by wxd on 2025/9/11.
//

#pragma once

#ifndef PHONGMATERIAL_H
#define PHONGMATERIAL_H

#include "Material.h"
#include "../glFramework/texture/Texture.h"
#include <string>
#include <memory>

// 定义冯式光照材质
class PhongMaterial : public Material {
public:
    static std::string uShininess;
    static std::string uDiffuseTexture;
    static std::string uSpecularTexture;
    static std::string uCameraPos;

    PhongMaterial() {
        mType = MaterialType::PHONG_MATERIAL;
    }
    explicit PhongMaterial(const std::string& name) : Material(name, MaterialType::PHONG_MATERIAL) {}
    PhongMaterial(const PhongMaterial& other) {}

    std::unique_ptr<IMaterial> clone() const override {
        return std::make_unique<PhongMaterial>(*this);
    }

    void setShininess(float shininess);
    void setDiffuseTexture(std::unique_ptr<Texture> texture);
    void setSpecularTexture(std::unique_ptr<Texture> texture);
    void setEnableSpecularMask(bool enable);

    float getShininess() const;
    Texture* getDiffuseTexture() const;
    Texture* getSpecularTexture() const;
    bool getEnableSpecularMask() const;

private:
    float mShininess { 0.f };
    bool mEnableSpecularMask { false };

    std::unique_ptr<Texture> mDiffuseTexture {};      // 漫反射纹理
    std::unique_ptr<Texture> mSpecularTexture {};     // 高光纹理
};

#endif //PHONGMATERIAL_H
